#include <stdio.h>
#include <stdlib.h>
#include <string.h>


void main41() {
    char s1[10], s2[20];
    gets(s1);
    gets(s2);
    int i = 0, j = sizeof(s2) - 3;
    while ((j < 20) && (i < 10)) {
        s2[j++] = s1[i++];
    }
    puts(s2);
}

void main42() {
    long jiechen(long n);
    long x, y, z = 0;

    while (1) {
        printf("计算阶乘\n请输入求几的阶乘\n");
        scanf("%ld", &x);
        for (int i = 1; i < x; i++)
            y = jiechen(x);
        z = z + 1 / y;


        printf("%ld\n", z);
    }

}

long jiechen(long n) {
    long s;
    if (n == 1)
        s = n;
    else s = jiechen(n - 1) * n;
    return (s);
}

char lianjie(char a[], char b[]) {

    char str1[100];
    int m = sizeof(a), n = sizeof(b);
    for (int i = 0; i < m; i++)
        str1[i] = a[i];

    for (int i = m; i <= (m + n); i++) {
        int c = 0;
        str1[m] = b[c++];


    }
    return (str1);
}


void main43() {
    char str[100] = "egthhfgcjtd";
    char strb[10] = "fhhvgkh";
    str[30] = lianjie(str, strb);
    puts(str);

    char str2[] = "egthhfgcjtd";
    printf("%d", sizeof(str2));
    printf("%d", strlen(str2));
}

void main44() {
    char love[4][7] = {{' ', '*', ' ', ' ', ' ', '*', ' '},
                       {'*', ' ', ' ', '*', ' ', ' ', '*'},
                       {' ', ' ', '*', ' ', '*', ' ', ' '},
                       {' ', ' ', ' ', '*', ' ', ' ', ' '}};
    int x, y;
    for (x = 0; x < 4; x++) {
        for (y = 0; y < 7; y++)
            printf("%c", love[x][y]);
        printf("\n");

    }
    getchar();
}


int jisuan(int a)
{
    int n,year;
    n=(a*5+8)*20;
    char x;
    printf("\n你生日过了吗？请输入Y或N：\n");
    scanf("%c",&x);
    switch (x)
    {
        case  'Y': n=n+1848;break;
        case  'N' : n=n+1847;break;
            //default  :  printf("\n输入错误\n");
    }






    //printf("请输入出去年份：");
    getchar();
    scanf ("%d",&year);

    getchar();

    n=n-year;
    n=n-a*100;

    printf("\n你的虚岁年龄是%d\n",n);

    return 0;
}

void main45()
{
    long qq;
    int f;
    printf("请输入QQ号码：");
    scanf("\n%ld",&qq);


    if(qq>999999999&&qq<10000000000)
    {

        f=qq/1000000000;
        jisuan(f);
    }
    if(qq>99999999&&qq<1000000000)
    {
        f=qq/100000000;
        jisuan(f);
    }


}
